package com.central.common.model;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.central.common.handler.ListLongToStringHandler;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.apache.ibatis.type.JdbcType;

import java.util.List;

import static com.baomidou.mybatisplus.annotation.FieldStrategy.NOT_NULL;

/**
 * @author td
 */
@Data
@EqualsAndHashCode(callSuper = true)
@TableName(value = "sys_department",autoResultMap = true)
public class SysDepartment extends SuperEntity {
	private static final long serialVersionUID = 749360940290141181L;
	private Long parentId;
	@TableField(jdbcType = JdbcType.VARCHAR, insertStrategy = NOT_NULL, typeHandler = ListLongToStringHandler.class)
	private List<Long> parentIds;
	private String name;

	@TableField(exist = false)
	private List<SysDepartment> subs;
}
